package IHM;


import application.appli;
import gestionVip.*;
import java.io.File;
import javax.swing.JOptionPane;
import plannificationProjections.Film;


public class IHM_VIP extends javax.swing.JFrame {
    
    
    public static int i=0;
    public IHM_VIP() {
        initComponents();
        suppression.setVisible(false);
        affichage.setVisible(false);
        modification.setVisible(false);
        bienvenito.setVisible(true);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        modification = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        suppression = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        affichage = new javax.swing.JPanel();
        jprenom = new javax.swing.JLabel();
        jnom = new javax.swing.JLabel();
        jage = new javax.swing.JLabel();
        jnationalite = new javax.swing.JLabel();
        jtype = new javax.swing.JLabel();
        jqa = new javax.swing.JLabel();
        jcompagnon = new javax.swing.JLabel();
        qa = new javax.swing.JTextField();
        compagnon = new javax.swing.JTextField();
        type = new javax.swing.JTextField();
        nationnalite = new javax.swing.JTextField();
        age = new javax.swing.JTextField();
        nom = new javax.swing.JTextField();
        prenom = new javax.swing.JTextField();
        precedent = new javax.swing.JButton();
        suivant = new javax.swing.JButton();
        jphoto = new javax.swing.JLabel();
        bienvenito = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        afficherVIP = new javax.swing.JMenuItem();
        ajouterVIP = new javax.swing.JMenuItem();
        modifierVIP = new javax.swing.JMenuItem();
        supprimerVIP = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        apropos = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel9.setText("Modifier");

        javax.swing.GroupLayout modificationLayout = new javax.swing.GroupLayout(modification);
        modification.setLayout(modificationLayout);
        modificationLayout.setHorizontalGroup(
            modificationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(modificationLayout.createSequentialGroup()
                .addGap(151, 151, 151)
                .addComponent(jLabel9)
                .addContainerGap(220, Short.MAX_VALUE))
        );
        modificationLayout.setVerticalGroup(
            modificationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(modificationLayout.createSequentialGroup()
                .addGap(144, 144, 144)
                .addComponent(jLabel9)
                .addContainerGap(163, Short.MAX_VALUE))
        );

        jLabel8.setText("Suppression");

        javax.swing.GroupLayout suppressionLayout = new javax.swing.GroupLayout(suppression);
        suppression.setLayout(suppressionLayout);
        suppressionLayout.setHorizontalGroup(
            suppressionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(suppressionLayout.createSequentialGroup()
                .addGap(139, 139, 139)
                .addComponent(jLabel8)
                .addContainerGap(171, Short.MAX_VALUE))
        );
        suppressionLayout.setVerticalGroup(
            suppressionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(suppressionLayout.createSequentialGroup()
                .addGap(106, 106, 106)
                .addComponent(jLabel8)
                .addContainerGap(161, Short.MAX_VALUE))
        );

        affichage.setEnabled(false);
        affichage.setPreferredSize(new java.awt.Dimension(500, 400));

        jprenom.setText("Prénom");
        jprenom.setAlignmentX(250.0F);
        jprenom.setAlignmentY(250.0F);

        jnom.setText("Nom");
        jnom.setAlignmentX(250.0F);
        jnom.setAlignmentY(250.0F);

        jage.setText("Age");
        jage.setAlignmentX(250.0F);
        jage.setAlignmentY(250.0F);

        jnationalite.setText("Nationnalité");
        jnationalite.setAlignmentX(250.0F);
        jnationalite.setAlignmentY(250.0F);

        jtype.setText("Type");
        jtype.setAlignmentX(250.0F);
        jtype.setAlignmentY(250.0F);

        jqa.setText("Quotient d'attrait");
        jqa.setAlignmentX(250.0F);
        jqa.setAlignmentY(250.0F);

        jcompagnon.setText("Compagnon");
        jcompagnon.setAlignmentX(250.0F);
        jcompagnon.setAlignmentY(250.0F);

        qa.setText("jTextField1");
        qa.setAlignmentX(250.0F);
        qa.setAlignmentY(250.0F);
        qa.setAutoscrolls(false);
        qa.setEnabled(false);
        qa.setPreferredSize(new java.awt.Dimension(100, 25));

        compagnon.setText("jTextField2");
        compagnon.setAlignmentX(250.0F);
        compagnon.setAlignmentY(250.0F);
        compagnon.setAutoscrolls(false);
        compagnon.setEnabled(false);
        compagnon.setPreferredSize(new java.awt.Dimension(100, 25));

        type.setText("jTextField3");
        type.setAlignmentX(250.0F);
        type.setAlignmentY(250.0F);
        type.setAutoscrolls(false);
        type.setEnabled(false);
        type.setPreferredSize(new java.awt.Dimension(100, 25));
        type.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                typeActionPerformed(evt);
            }
        });

        nationnalite.setText("jTextField4");
        nationnalite.setAlignmentX(250.0F);
        nationnalite.setAlignmentY(250.0F);
        nationnalite.setAutoscrolls(false);
        nationnalite.setEnabled(false);
        nationnalite.setPreferredSize(new java.awt.Dimension(100, 25));

        age.setText("jTextField5");
        age.setAlignmentX(250.0F);
        age.setAlignmentY(250.0F);
        age.setAutoscrolls(false);
        age.setEnabled(false);
        age.setPreferredSize(new java.awt.Dimension(100, 25));

        nom.setText("jTextField6");
        nom.setAlignmentX(250.0F);
        nom.setAlignmentY(250.0F);
        nom.setAutoscrolls(false);
        nom.setEnabled(false);
        nom.setPreferredSize(new java.awt.Dimension(100, 25));

        prenom.setAlignmentX(250.0F);
        prenom.setAlignmentY(250.0F);
        prenom.setAutoscrolls(false);
        prenom.setEnabled(false);
        prenom.setPreferredSize(new java.awt.Dimension(100, 25));
        prenom.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                prenomActionPerformed(evt);
            }
        });

        precedent.setText("Précedent");
        precedent.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                precedentActionPerformed(evt);
            }
        });

        suivant.setText("Suivant");
        suivant.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                suivantActionPerformed(evt);
            }
        });

        jphoto.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jphotoMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout affichageLayout = new javax.swing.GroupLayout(affichage);
        affichage.setLayout(affichageLayout);
        affichageLayout.setHorizontalGroup(
            affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(affichageLayout.createSequentialGroup()
                .addGap(111, 111, 111)
                .addGroup(affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, affichageLayout.createSequentialGroup()
                        .addGroup(affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jprenom)
                            .addGroup(affichageLayout.createSequentialGroup()
                                .addGap(2, 2, 2)
                                .addGroup(affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jage)
                                    .addComponent(jtype)
                                    .addComponent(jnationalite)
                                    .addComponent(jqa)
                                    .addComponent(jcompagnon)))
                            .addComponent(jnom))
                        .addGap(110, 110, 110)
                        .addGroup(affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(age, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(nationnalite, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(compagnon, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(qa, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(nom, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(type, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(prenom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, affichageLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(precedent)
                        .addGap(29, 29, 29)
                        .addComponent(suivant)
                        .addGap(83, 83, 83)))
                .addGap(93, 93, 93))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, affichageLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jphoto, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(78, 78, 78))
        );
        affichageLayout.setVerticalGroup(
            affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, affichageLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jphoto, javax.swing.GroupLayout.DEFAULT_SIZE, 108, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addGroup(affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jprenom)
                    .addComponent(prenom, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jnom)
                    .addComponent(nom, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jage)
                    .addComponent(age, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jnationalite)
                    .addComponent(nationnalite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jtype)
                    .addComponent(type, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jqa)
                    .addComponent(qa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jcompagnon)
                    .addComponent(compagnon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(affichageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(precedent)
                    .addComponent(suivant))
                .addContainerGap())
        );

        bienvenito.setPreferredSize(new java.awt.Dimension(374, 312));

        jLabel10.setText("Bienvenue dans le programme du futur");

        javax.swing.GroupLayout bienvenitoLayout = new javax.swing.GroupLayout(bienvenito);
        bienvenito.setLayout(bienvenitoLayout);
        bienvenitoLayout.setHorizontalGroup(
            bienvenitoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bienvenitoLayout.createSequentialGroup()
                .addGap(87, 87, 87)
                .addComponent(jLabel10)
                .addContainerGap(101, Short.MAX_VALUE))
        );
        bienvenitoLayout.setVerticalGroup(
            bienvenitoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bienvenitoLayout.createSequentialGroup()
                .addGap(133, 133, 133)
                .addComponent(jLabel10)
                .addContainerGap(165, Short.MAX_VALUE))
        );

        jMenu1.setText("Fichier");

        afficherVIP.setText("Afficher");
        afficherVIP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                afficherVIPActionPerformed(evt);
            }
        });
        jMenu1.add(afficherVIP);

        ajouterVIP.setText("Ajouter un VIP");
        ajouterVIP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ajouterVIPActionPerformed(evt);
            }
        });
        jMenu1.add(ajouterVIP);

        modifierVIP.setText("Modifier une fiche");
        modifierVIP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modifierVIPActionPerformed(evt);
            }
        });
        jMenu1.add(modifierVIP);

        supprimerVIP.setText("Supprimer une fiche");
        supprimerVIP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                supprimerVIPActionPerformed(evt);
            }
        });
        jMenu1.add(supprimerVIP);

        jMenuBar1.add(jMenu1);

        jMenu3.setText("Aide");

        apropos.setText("A propos");
        apropos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aproposActionPerformed(evt);
            }
        });
        jMenu3.add(apropos);

        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(affichage, javax.swing.GroupLayout.DEFAULT_SIZE, 522, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(20, 20, 20)
                    .addComponent(suppression, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(154, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(modification, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(123, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(bienvenito, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(158, Short.MAX_VALUE)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(affichage, javax.swing.GroupLayout.DEFAULT_SIZE, 408, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(suppression, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(116, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(modification, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(76, Short.MAX_VALUE)))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(44, Short.MAX_VALUE)
                    .addComponent(bienvenito, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(52, Short.MAX_VALUE)))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void ajouterVIPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ajouterVIPActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_ajouterVIPActionPerformed

    private void modifierVIPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modifierVIPActionPerformed
        suppression.setVisible(false);
        affichage.setVisible(false);
        modification.setVisible(true);        // TODO add your handling code here:
    }//GEN-LAST:event_modifierVIPActionPerformed

    private void supprimerVIPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_supprimerVIPActionPerformed
        // TODO add your handling code here:
        suppression.setVisible(true);
        affichage.setVisible(false);
        modification.setVisible(false);
    }//GEN-LAST:event_supprimerVIPActionPerformed

    private void afficherVIPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_afficherVIPActionPerformed
        // TODO add your handling code here:
        suppression.setVisible(false);
        affichage.setVisible(true);
        modification.setVisible(false);
        this.precedentActionPerformed(evt);
    }//GEN-LAST:event_afficherVIPActionPerformed

    private void aproposActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aproposActionPerformed
        // TODO add your handling code here:
        suppression.setVisible(false);
        affichage.setVisible(false);
        modification.setVisible(false);
        bienvenito.setVisible(false);
    }//GEN-LAST:event_aproposActionPerformed

    private void suivantActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_suivantActionPerformed
        // TODO add your handling code here:
        //!(appli.listeVip.get(i+1) instanceof Vip)
        if(appli.listeVip.size()<i+1)
        {
            i=appli.listeVip.size()+1;
            nom.setText("Fin");
            prenom.setText("Fin");
            age.setText("Fin");
            nationnalite.setText("Fin");
            type.setText("Fin");
            qa.setText("Fin");
            compagnon.setText("Fin");
            suivant.setEnabled(false);
            jphoto.setIcon(null);
        }
        else
        {
            precedent.setEnabled(true);
            i++;
            String value = (String) appli.listeVip.get(i).getNom();
            String photo = "/IHM/"+appli.listeVip.get(i).getPrenom()+appli.listeVip.get(i).getNom()+".jpg";
            String photo2 = "/Appli Synth S4 DAIROS/Cannes_UML/src" + photo;
            File f = new File(photo2);
            if ( f.getAbsoluteFile().exists() ) {
            jphoto.setIcon(new javax.swing.ImageIcon(getClass().getResource(photo)));
            }            
            else
            {
            jphoto.setIcon(null);
            }
            nom.setText(value);
            prenom.setText(appli.listeVip.get(i).getPrenom());
            age.setText(String.valueOf(appli.listeVip.get(i).getAge()));
            nationnalite.setText(appli.listeVip.get(i).getNationnalite());
            type.setText(appli.listeVip.get(i).getType());
            qa.setText(String.valueOf(appli.listeVip.get(i).getQa()));
            compagnon.setText(appli.listeVip.get(i).getCompagnon());

        }
    }//GEN-LAST:event_suivantActionPerformed

    private void precedentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_precedentActionPerformed
        // TODO add your handling code here:
        if(i-1==0 || i==0)
        {
            i=0;
            nom.setText("Début");
            prenom.setText("Début");
            age.setText("Début");
            nationnalite.setText("Début");
            type.setText("Début");
            qa.setText("Début");
            compagnon.setText("Début");
            precedent.setEnabled(false);
            jphoto.setIcon(null);
        }
        else
        {
            suivant.setEnabled(true);
            i--;
            String value = (String) appli.listeVip.get(i).getNom();
            nom.setText(value);
            prenom.setText(appli.listeVip.get(i).getPrenom());
            String photo = "/IHM/"+appli.listeVip.get(i).getPrenom()+appli.listeVip.get(i).getNom()+".jpg";
            String photo2 = "/Appli Synth S4 DAIROS/Cannes_UML/src" + photo;
            File f = new File(photo2);
            if ( f.getAbsoluteFile().exists() ) {
            jphoto.setIcon(new javax.swing.ImageIcon(getClass().getResource(photo)));
            }            
            else
            {
            jphoto.setIcon(null);
            }
            age.setText(String.valueOf(appli.listeVip.get(i).getAge()));
            nationnalite.setText(appli.listeVip.get(i).getNationnalite());
            type.setText(appli.listeVip.get(i).getType());
            qa.setText(String.valueOf(appli.listeVip.get(i).getQa()));
            compagnon.setText(appli.listeVip.get(i).getCompagnon());
        }
    }//GEN-LAST:event_precedentActionPerformed

    private void prenomActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_prenomActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_prenomActionPerformed

    private void typeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_typeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_typeActionPerformed

    private void jphotoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jphotoMouseClicked
        // TODO add your handling code here:
        if(appli.listeVip.get(i).getType()=="Acteur" || appli.listeVip.get(i).getType()=="Realisateur")
        {JOptionPane.showMessageDialog(this,"Liste Film"," A propos",JOptionPane.INFORMATION_MESSAGE);}
        else if(appli.listeVip.get(i).getType()=="Journaliste" )
        {JOptionPane.showMessageDialog(this,"Infos Agence"," A propos",JOptionPane.INFORMATION_MESSAGE);}
        else
        {JOptionPane.showMessageDialog(this,"Autre"," A propos",JOptionPane.INFORMATION_MESSAGE);}
    }//GEN-LAST:event_jphotoMouseClicked

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(IHM_VIP.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(IHM_VIP.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(IHM_VIP.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(IHM_VIP.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new IHM_VIP().setVisible(true);
            }
        });
        
         Film[] tabFilm = new Film[500];
         Object photo = new Object();
         tabFilm[0]=new Film(1,"Seven","Albert","Pitt Freeman","Thriller","LM");
         tabFilm[1]=new Film(2,"Kill Bill","Tarentino","Thurman Carradine","Gore","LM");
         Vip john = new Acteur(1,tabFilm,"Pitt","Brad",49,"USA",photo,"Acteur",9,"AJ");
         Vip cb = new Realisateur(2,tabFilm,"Berry","Claude",60,"Francais",photo,"Realisateur",50,"AJ");
         Vip ab = new Journaliste(3,"Télévision","TF1","1","TF",60,"Francais",photo,"Journaliste",50,"AJ");
         Vip autre = new Autre(4,"Man","Nobody",24,"Francais",photo,"Autre",2,"Celibataire");
         appli.listeVip.put(cb.getIdVIP(), cb);
         appli.listeVip.put(john.getIdVIP(), john);
         appli.listeVip.put(ab.getIdVIP(), ab);
         appli.listeVip.put(autre.getIdVIP(), autre);
        
        
        
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel affichage;
    private javax.swing.JMenuItem afficherVIP;
    private javax.swing.JTextField age;
    private javax.swing.JMenuItem ajouterVIP;
    private javax.swing.JMenuItem apropos;
    private javax.swing.JPanel bienvenito;
    private javax.swing.JTextField compagnon;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JLabel jage;
    private javax.swing.JLabel jcompagnon;
    private javax.swing.JLabel jnationalite;
    private javax.swing.JLabel jnom;
    private javax.swing.JLabel jphoto;
    private javax.swing.JLabel jprenom;
    private javax.swing.JLabel jqa;
    private javax.swing.JLabel jtype;
    private javax.swing.JPanel modification;
    private javax.swing.JMenuItem modifierVIP;
    private javax.swing.JTextField nationnalite;
    private javax.swing.JTextField nom;
    private javax.swing.JButton precedent;
    private javax.swing.JTextField prenom;
    private javax.swing.JTextField qa;
    private javax.swing.JButton suivant;
    private javax.swing.JPanel suppression;
    private javax.swing.JMenuItem supprimerVIP;
    private javax.swing.JTextField type;
    // End of variables declaration//GEN-END:variables
}
